<div id="member_signed_out" class="member_sign">

    <div class="sign_tab">
        <h2><span class="blind">成员</span>登录</h2>
        <a href="/bbs/login" class="in">登录</a>
        <a href="/bbs/register" class="join">会员</a>
    </div>

    <form name="foutlogin" action="/bbs/login" onsubmit="return fhead_submit(this);" method="post" autocomplete="off">
        <input type="hidden" name="url" value="{{ request.url }}">

        <div class="sign_form">
            <label for="ol_id" id="ol_idlabel" class="blind">会员Id<strong>必不可少的</strong></label>
            <input type="text" id="ol_id" name="mb_id" required class="required alnum_" maxlength="20" placeholder="Idie">

            <label for="ol_pw" id="ol_pwlabel" class="blind">密码<strong>必不可少的</strong></label>
            <input type="password" name="mb_password" id="ol_pw" required class="required" maxlength="20" placeholder="密码">

            <input type="submit" id="ol_submit" value="登录" class="btn_b02">
        </div>

        <div class="sign_option">
            <div class="chk_box">
                <input type="checkbox" name="auto_login" id="auto_login">
                <label for="auto_login"><span></span>自动登录</label>
            </div>

            <div>
                <a href="/bbs/id_lost">ID 查找</a> / 
                <a href="/bbs/password_lost">PW 查找</a>
            </div>
        </div>

    </form>
</div>

{% include "social/social_login.html" %}

<script>
document.addEventListener('DOMContentLoaded', function() {

    const omi = document.querySelector('#ol_id'),
        omp = document.querySelector('#ol_pw'),
        omi_label = document.querySelector('#ol_idlabel'),
        omp_label = document.querySelector('#ol_pwlabel');

    omp_label.classList.add('ol_pwlabel');
    omi_label.classList.add('ol_idlabel');
    
    const autoLogin = document.querySelector('#auto_login');
    autoLogin.addEventListener('click', function() {
        if (this.checked) {
        const confirm_result  = confirm("如果您使用自动登录，则无需从以下位置输入会员的姓名和密码:.\n\n请不要在公共场所使用个人信息。.\n\n是否使用自动登录?")
            if (!confirm_result) {
                return this.checked = false;
            }
        }
    });
});

function fhead_submit(f)
{
    if( $( document.body ).triggerHandler( 'outlogin1', [f, 'foutlogin'] ) !== false ){
        return true;
    }
    return false;
}

</script>